< previous page page_627 next page >

Page 627
Common Properties of the ImageCombo Control
The ImageCombo control has few properties other than the standard ones that are worth mentioning. Table 30.7 lists those properties youll likely be setting for the ImageCombo control.
Table 30.7 Common Properties of the ImageCombo Control.
PropertyDescription
ImageListSet this property to the name of a valid ImageList control on the same form as the ImageCombo control. Unlike with the toolbar control, you can add to the ImageList control thats tied to this control. Because everything is created at runtime, theres no problem with adding other items.
ComboItemsThis runtime property exposes the collection of ComboItem objects to you. Each item in the list is a ComboItem object. You might use this property to loop through the collection and perform some action against each item in the list.
SelectedItemThis property returns the currently selected ComboItem object to you.

Loading the ComboItems Collection
To load the ImageCombo control, you use the Add method of the ComboItems collection. When you add a top-level item, you dont specify an indentation level; for all other items, though, you will specify an indentation level. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub ComboLoad()
   With icboItems
      ' Load Computer Items
      .ComboItems.Add , "Computer", _
                       "Computer Items", _
                       "PC"
      .ComboItems.Add , "DiskDrive", _
                       "Disk Drives", _
                       "DiskDrive", _
                       , 3
      .ComboItems.Add , "FloppyDrive", _
                       "Floppy Drives", _

 
< previous page page_627 next page >

If you like this book, buy it!